@include('admin.header')
<style>
form{

	
}
label{
	line-height:40px;
}
label span{
	display: inline-block;
	width: 150px;
	text-align: right;
}
input[type="submit"]{
	position: absolute;
	right: 20px;
	bottom: 20px;
	margin-left: 20px;
	display: inline-block;
	text-align: right;
}




</style>
</head>
<body>
	<div class="wrap js-check-wrap">

		<form  method="post" class="js-ajax-tree js-category-add">
			<div>
				<label>
				<span>钱包类型：</span>
				 <select name="pursetype">
					<option value="0" @if($id>0){@if($data->pursetype == 0){echo selected="selected";} @endif}@endif>None</option>	
					<option value="1" @if($id>0){@if($data->pursetype == 1){echo selected="selected";} @endif}@endif>收益账户</option>	
					<option value="2" @if($id>0){@if($data->pursetype == 2){echo selected="selected";} @endif}@endif>现金账户</option>	
					<option value="3" @if($id>0){@if($data->pursetype == 3){echo selected="selected";} @endif}@endif>积分账户</option>	
					<option value="4" @if($id>0){@if($data->pursetype == 4){echo selected="selected";} @endif}@endif>o2o收益账户</option>	
					<option value="96" @if($id>0){@if($data->pursetype == 96){echo selected="selected";} @endif}@endif>过账账户</option>	
					<option value="97" @if($id>0){@if($data->pursetype == 97){echo selected="selected";} @endif}@endif>授信账户</option>	
					<option value="98" @if($id>0){@if($data->pursetype == 98){echo selected="selected";} @endif}@endif>中央银行账户</option>	
					<option value="99" @if($id>0){@if($data->pursetype == 99){echo selected="selected";} @endif}@endif>系统收益账户</option>	
				 </select>
				</label>

			   <label>
				<span>拥有者账号：</span>
				<input type="text" name="reson_name" value="{{$data->reson_name or ''}}"/>
				</label>
				<label>
				<span>拥有者类型：</span>
				 <select name="ownertype">
					<option value="">None</option>	
					<option value="1" @if($id>0){@if($data->ownertype == 1){echo selected="selected";} @endif}@endif >用户账户</option>	
					<option value="2" @if($id>0){@if($data->ownertype == 2){echo selected="selected";} @endif}@endif>商家账户</option>	
					<option value="3" @if($id>0){@if($data->ownertype == 3){echo selected="selected";} @endif}@endif>企业账户</option>	
					<option value="99" @if($id>0){@if($data->ownertype == 99){echo selected="selected";} @endif}@endif>系统账户</option>	
				 </select>
				</label>

				<label>
				<span>子钱包：</span>
				<input type="text" name="subid" value="{{$data->subid or ''}}"/>
				</label>
				<label>
				<span>最小金额：</span>
				<input type="text" name="minvalue" value="{{$data->minvalue or ''}}"/>
				</label>
				<label>
				<span>货币类型：</span>
				 <select name="currencytype" id="currencytype">
				 <option value="">--请选择--</option>
				 @foreach($currency as $key => $v)
					<option value="{{$v->currencyid}}" @if(isset($data->currencyid) && $data->currencyid == $v->currencyid){echo selected="selected";} @endif >{{$v->currency_type}}_{{$v->currency_unit}}</option>	
				 @endforeach	
				 </select>
				</label>

				<input type="hidden" name="reson_id" value="{{$data->reson_id or ''}}"/>
				<input type="submit" class="btn btn-primary" value="提交" />
				
			</div>
		</form>
	</div>
	<script type="text/javascript" src="/static/js/common.js"></script>
	<script type="text/javascript" src="/static/js/validate/validate.js"></script>
	<script type="text/javascript" src="/static/js/layer/layer.js"></script>
	<script type="text/javascript">
			$(function() {

			$(".js-category-add").validate({
				// rules: {
				// 	reson_name: {
				// 		required: true
				// 	}
				// },
				// messages: {
				// 	reson_name: {
				// 		required: "转账原因不为空"
				// 	}
				// },
				submitHandler: function () {
					alert('暂时不支持创建钱包');return;
					$.post("/basiconfig/{{$action}}",$('.js-category-add').serialize(), function (msg) {
						if (msg.status == 1) {
							layer.confirm(msg.info, {
								btn: ['确定']
							}, function(){
								@if($action == 'add_reason')
									window.location.href="{{asset('basiconfig/transfer_reason')}}";
								@else
									window.location.href="{{asset('basiconfig/transfer_reason')}}";
								@endif
							});
						} else {
							showMsg(msg.info);
						}
					}, 'json');
					return false;
				}
			});
		});
		/**
		 * layer提示
		 */
		function showMsg(msg){
			layer.alert(msg, {
				title: '提示',
				icon: 2,
			});
		}
	</script>
</body>
</html>